/*
 * Copyright (C) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef IMAGE_KNIFE_C_KEKE_IMAGEKNIFE_TRACE_H
#define IMAGE_KNIFE_C_KEKE_IMAGEKNIFE_TRACE_H
#include "imageknife_task_internal.h"

namespace ImageKnifePro {

class ImageKnifeTrace {
public:
    /**
     * @brief 开始记录同步Trace
     */
    void StartSyncTrace();
    /**
     * @brief 结束记录Trace
     * 如过没有调用，将在ImageKnifeTrace对象析构时标记Trace结束
     */
    void FinishTrace();

    explicit ImageKnifeTrace(std::string info);
    ImageKnifeTrace(std::string info, std::string componentId);
    ImageKnifeTrace(std::string info, std::shared_ptr<ImageKnifeTaskInternal> task);
    ImageKnifeTrace(std::string info, std::shared_ptr<ImageKnifeRequestInternal> request);
    ImageKnifeTrace(std::string info, std::shared_ptr<ImageKnifeRequestInternal> request, ImageRequestType type);
    ~ImageKnifeTrace();
private:
    bool started_ = false;
    bool syncTrace_ = true;
    std::string traceName_;
};
}

#endif //IMAGE_KNIFE_C_KEKE_IMAGEKNIFE_TRACE_H
